<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>audio和vedio元素 | 学习笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="Jiesen">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../HTML5/iframe标签.html" />
    
    
    <link rel="prev" href="../HTML5/HTML5新增元素.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.1"
        data-chapter-title="audio和vedio元素"
        data-filepath="HTML5/audio和vedio元素.md"
        data-basepath=".."
        data-revision="Sun Sep 23 2018 15:52:51 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="HTML/HTML.html">
            
                
                    <a href="../HTML/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="HTML/html简介.html">
            
                
                    <a href="../HTML/html简介.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        html简介
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="HTML/a链接.html">
            
                
                    <a href="../HTML/a链接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        a链接
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="HTML/标签.html">
            
                
                    <a href="../HTML/标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="HTML/img.html">
            
                
                    <a href="../HTML/img.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        img
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="HTML/列表.html">
            
                
                    <a href="../HTML/列表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="HTML/form表单.html">
            
                
                    <a href="../HTML/form表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        form表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="HTML/常用from表单类型.html">
            
                
                    <a href="../HTML/常用from表单类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        常用from表单类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="HTML/tabel表格.html">
            
                
                    <a href="../HTML/tabel表格.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        tabel表格
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="HTML5/HTML5新增元素.html">
            
                
                    <a href="../HTML5/HTML5新增元素.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        HTML5新增元素
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="2.1" data-path="HTML5/audio和vedio元素.html">
            
                
                    <a href="../HTML5/audio和vedio元素.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        audio和vedio元素
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="HTML5/iframe标签.html">
            
                
                    <a href="../HTML5/iframe标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        iframe标签
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="CSS/CSS简介.html">
            
                
                    <a href="../CSS/CSS简介.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        CSS简介
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="CSS/CSS选择器.html">
            
                
                    <a href="../CSS/CSS选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        CSS选择器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >学习笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="audio&#x548C;vedio&#x5143;&#x7D20;">audio&#x548C;vedio&#x5143;&#x7D20;</h1>
<h2 id="&#x4E00;&#x3001;audio&#x5143;&#x7D20;">&#x4E00;&#x3001;audio&#x5143;&#x7D20;</h2>
<h3 id="1&#x8BED;&#x6CD5;&#xFF1A;">1.&#x8BED;&#x6CD5;&#xFF1A;</h3>
<p><code>&lt;audio src=&quot;media/music.mp3&quot; autoplay muted&gt;&lt;/audio&gt;</code></p>
<h4 id="2&#x5C0F;&#x7ED3;&#xFF1A;">2.&#x5C0F;&#x7ED3;&#xFF1A;</h4>
<table>
<thead>
<tr>
<th>&#x5C5E;&#x6027;</th>
<th style="text-align:right">&#x4F5C;&#x7528;</th>
</tr>
</thead>
<tbody>
<tr>
<td>audio</td>
<td style="text-align:right">&#x4F7F;&#x7528;&#x97F3;&#x9891;&#x7684;&#x6807;&#x7B7E;</td>
</tr>
<tr>
<td>-src</td>
<td style="text-align:right">&#x5F15;&#x5165;&#x7684;&#x8D44;&#x6E90;</td>
</tr>
<tr>
<td>-control</td>
<td style="text-align:right">&#x63A7;&#x5236;&#x9762;&#x677F;&#xFF08;&#x5728;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x4E0B;&#xFF0C;&#x6837;&#x5F0F;&#x4F1A;&#x6709;&#x6240;&#x4E0D;&#x540C;</td>
</tr>
<tr>
<td>-autoplay</td>
<td style="text-align:right">&#x81EA;&#x52A8;&#x64AD;&#x653E;</td>
</tr>
<tr>
<td>-preload</td>
<td style="text-align:right">&#x9884;&#x52A0;&#x8F7D;</td>
</tr>
<tr>
<td>-volume</td>
<td style="text-align:right">&#x97F3;&#x91CF;</td>
</tr>
<tr>
<td>-muted</td>
<td style="text-align:right">&#x9759;&#x97F3;</td>
</tr>
<tr>
<td>-volume</td>
<td style="text-align:right">&#x97F3;&#x91CF;&#xFF08;js&#x63A7;&#x5236;)</td>
</tr>
</tbody>
</table>
<h3 id="2&#x517C;&#x5BB9;&#x591A;&#x79CD;&#x683C;&#x5F0F;&#x6587;&#x4EF6;&#x7684;&#x5199;&#x6CD5;">2.&#x517C;&#x5BB9;&#x591A;&#x79CD;&#x683C;&#x5F0F;&#x6587;&#x4EF6;&#x7684;&#x5199;&#x6CD5;</h3>
<h4 id="1&#x8BED;&#x6CD5;">1.&#x8BED;&#x6CD5;</h4>
<p><code>&lt;audio &gt;
            &lt;source src=&quot;media/ogg.mp3&quot;type=&quot;audio/mp3&quot;&gt;&lt;/source&gt;
            &lt;source src=&quot;media/ogg.ogg&quot;type=&quot;audio/ogg&quot;&gt;&lt;/source&gt;
            &lt;source src=&quot;media/video.webm&quot; type=&quot;video/webm&quot;&lt;/source&gt;
            &#x5F53;&#x524D;&#x6D4F;&#x89C8;&#x5668;&#x4E0D;&#x652F;&#x6301;audio&#x76F4;&#x63A5;&#x64AD;&#x653E;&#xFF0C;&#x70B9;&#x51FB;&#x8FD9;&#x91CC;&#x4E0B;&#x8F7D;&#x89C6;&#x9891;&#xFF1A;&lt;a href=&quot;myvideo.webm&quot;&gt;&#x4E0B;&#x8F7D;&#x89C6;&#x9891;&lt;/a&gt;
        &lt;/audio&gt;</code></p>
<h4 id="2&#x5C0F;&#x7ED3;&#xFF1A;">2.&#x5C0F;&#x7ED3;&#xFF1A;</h4>
<pre><code>        source&#x6807;&#x7B7E;&#x7528;&#x4E8E;&#x5F15;&#x7528;&#x8D44;&#x6E90;&#x4F7F;&#x7528;
        -type &#x89C4;&#x5B9A;&#x6587;&#x4EF6;&#x7684;&#x7C7B;&#x578B;
</code></pre><h1 id="&#x4E00;&#x3001;vedio&#x5143;&#x7D20;">&#x4E00;&#x3001;vedio&#x5143;&#x7D20;</h1>
<h3 id="1&#x8BED;&#x6CD5;&#xFF1A;">1.&#x8BED;&#x6CD5;&#xFF1A;</h3>
<p><code>&lt;audio src=&quot;song.ogg&quot; controls=&quot;controls&quot;&gt;&lt;/audio&gt;</code></p>
<h3 id="2&#x5982;&#x679C;&#x8003;&#x8651;&#x5230;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x89C6;&#x9891;&#x6587;&#x4EF6;&#x7684;&#x517C;&#x5BB9;&#x6027;">2.&#x5982;&#x679C;&#x8003;&#x8651;&#x5230;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x89C6;&#x9891;&#x6587;&#x4EF6;&#x7684;&#x517C;&#x5BB9;&#x6027;</h3>
<h4 id="1&#x8BED;&#x6CD5;&#xFF1A;">1.&#x8BED;&#x6CD5;&#xFF1A;</h4>
<p><code>&lt;audio width=&quot;320&quot; height=&quot;240&quot; controls=&quot;controls&quot;&gt;
  &lt;source src=&quot;song.ogg&quot; type=&quot;audio/ogg&quot;&gt;
  &lt;source src=&quot;song.mp3&quot; type=&quot;audio/mpeg&quot;&gt;
  &lt;p&gt;Your browser does not support the audio tag.&lt;/p&gt;
&lt;/audio &gt;</code></p>
<h4 id="2&#x5C0F;&#x7ED3;&#xFF1A;">2.&#x5C0F;&#x7ED3;&#xFF1A;</h4>
<table>
<thead>
<tr>
<th>&#x5C5E;&#x6027;</th>
<th style="text-align:right">&#x4F5C;&#x7528;</th>
</tr>
</thead>
<tbody>
<tr>
<td>audio</td>
<td style="text-align:right">&#x4F7F;&#x7528;&#x97F3;&#x9891;&#x7684;&#x6807;&#x7B7E;</td>
</tr>
<tr>
<td>-src</td>
<td style="text-align:right">&#x5F15;&#x5165;&#x7684;&#x8D44;&#x6E90;</td>
</tr>
<tr>
<td>-control</td>
<td style="text-align:right">&#x63A7;&#x5236;&#x9762;&#x677F;&#xFF08;&#x5728;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x4E0B;&#xFF0C;&#x6837;&#x5F0F;&#x4F1A;&#x6709;&#x6240;&#x4E0D;&#x540C;</td>
</tr>
<tr>
<td>-autoplay</td>
<td style="text-align:right">&#x81EA;&#x52A8;&#x64AD;&#x653E;</td>
</tr>
<tr>
<td>-preload</td>
<td style="text-align:right">&#x9884;&#x52A0;&#x8F7D;</td>
</tr>
<tr>
<td>-volume</td>
<td style="text-align:right">&#x97F3;&#x91CF;</td>
</tr>
<tr>
<td>-muted</td>
<td style="text-align:right">&#x9759;&#x97F3;</td>
</tr>
<tr>
<td>-volume</td>
<td style="text-align:right">&#x97F3;&#x91CF;&#xFF08;js&#x63A7;&#x5236;)</td>
</tr>
<tr>
<td>poster&#xFF08;URL    &#xFF09;</td>
<td style="text-align:right">&#x89C4;&#x5B9A;&#x89C6;&#x9891;&#x4E0B;&#x8F7D;&#x65F6;&#x663E;&#x793A;&#x7684;&#x56FE;&#x50CF;&#xFF0C;&#x6216;&#x8005;&#x5728;&#x7528;&#x6237;&#x70B9;&#x51FB;&#x64AD;&#x653E;&#x6309;&#x94AE;&#x524D;&#x663E;&#x793A;&#x7684;&#x56FE;&#x50CF;&#x3002;</td>
</tr>
<tr>
<td>src</td>
<td style="text-align:right">&#xFF08;url)&#x8981;&#x64AD;&#x653E;&#x7684;&#x89C6;&#x9891;&#x7684; URL&#x3002;</td>
</tr>
<tr>
<td>width(pixels)</td>
<td style="text-align:right">&#x8BBE;&#x7F6E;&#x89C6;&#x9891;&#x64AD;&#x653E;&#x5668;&#x7684;&#x5BBD;&#x5EA6;&#x3002;</td>
</tr>
<tr>
<td>height(pixels)</td>
<td style="text-align:right">&#x8BBE;&#x7F6E;&#x89C6;&#x9891;&#x64AD;&#x653E;&#x5668;&#x7684;&#x9AD8;&#x5EA6;&#x3002;</td>
</tr>
</tbody>
</table>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../HTML5/HTML5新增元素.html" class="navigation navigation-prev " aria-label="Previous page: HTML5新增元素"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../HTML5/iframe标签.html" class="navigation navigation-next " aria-label="Next page: iframe标签"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
